package com.lh.java.junit;

/**
 ************************************************ 
 ** Module : junit测试类 Date: 2012-2-15 Time: 上午10:29:36 Author lh
 ************************************************ 
 */
public class Calculator {
	private static int result;

	public void add(int n) {
		result += n;
	}

	public void sub(int n){
		int i = 1/0;
		result += i;
	}

	public void square(int n) {
		while(true){
			System.out.println("a");
		}
		
	}

	public int squareRoot(int n) {
		return result = (int)Math.sqrt(n);
	}

	public void clear() {
		result = 0;
	}

	public double getResult() {
		return result;
	}

}
